﻿<Window x:Class="LogicCircuit.DialogConstant"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:lc="clr-namespace:LogicCircuit"
	xmlns:properties="clr-namespace:LogicCircuit.Properties"
	WindowStartupLocation="CenterOwner"
	Title="{x:Static properties:Resources.NameConstant}"
	Style="{StaticResource DialogWindow}"
	FocusManager.FocusedElement="{Binding ElementName=value}"
>
	<lc:AutoGrid Margin="3">
		<Label Content="{x:Static properties:Resources.TitleBitWidth}"/>
		<ComboBox Name="bitWidth"
			ItemsSource="{x:Static lc:PinDescriptor.BitWidthRange}"
			ToolTip="{x:Static properties:Resources.ToolTipConstantBitWidth}"
			Width="{Binding ElementName=side, Path=ActualWidth}"
			HorizontalAlignment="Left"
		/>

		<Label Content="{x:Static properties:Resources.TitleValue}"/>
		<TextBox Name="value" ToolTip="{x:Static properties:Resources.ToolTipConstantValue}" HorizontalAlignment="Left" Width="{Binding ElementName=side, Path=ActualWidth}" SpellCheck.IsEnabled="False"/>

		<Label Content="{x:Static properties:Resources.TitlePinSide}"/>
		<lc:AutoWidthComboBox x:Name="side"
			ItemsSource="{x:Static lc:PinDescriptor.PinSideRange}"
			ToolTip="{x:Static properties:Resources.ToolTipDevicePinSide}"
		/>

		<Label Content="{x:Static properties:Resources.TitleDescription}"/>
		<TextBox Name="note" AcceptsReturn="True"/>

		<StackPanel Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom">
			<Button Content="{x:Static properties:Resources.TitleOK}" IsDefault="True" Click="ButtonOkClick"/>
			<Button Content="{x:Static properties:Resources.TitleCancel}" IsCancel="True"/>
		</StackPanel>
	</lc:AutoGrid>
</Window>
